/*
 * CompiladorView.java
 */

package compilador2011;

import Lexico.AnalizadorLexico;
import Parser.Parser;
import Mensajes.Mensaje;
import FileManager.ManejadorArchivo;
import PolacaInversa.Polaca;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.text.BadLocationException;
import org.jdesktop.application.Action;
import org.jdesktop.application.ResourceMap;
import org.jdesktop.application.SingleFrameApplication;
import org.jdesktop.application.FrameView;
import org.jdesktop.application.TaskMonitor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Observable;
import java.util.Observer;
import java.util.Vector;
import javax.swing.Timer;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.table.DefaultTableModel;
import TablaDeSimbolos.TSimbolo;
import TokensDelLenguaje.Tokens;
import TokensDelLenguaje.Token;
import java.io.FileOutputStream;
import java.util.List;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.text.DefaultEditorKit;
import org.jdesktop.application.Application;

/**
 * The application's main frame.
 */
public class Compilador2011View extends FrameView implements Observer {
    
    public Compilador2011View(SingleFrameApplication app) {
        super(app);

        initComponents();

        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                String propertyName = evt.getPropertyName();
                if ("started".equals(propertyName)) {
                    if (!busyIconTimer.isRunning()) {
                        statusAnimationLabel.setIcon(busyIcons[0]);
                        busyIconIndex = 0;
                        busyIconTimer.start();
                    }
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(true);
                } else if ("done".equals(propertyName)) {
                    busyIconTimer.stop();
                    statusAnimationLabel.setIcon(idleIcon);
                    progressBar.setVisible(false);
                    progressBar.setValue(0);
                } else if ("message".equals(propertyName)) {
                    String text = (String)(evt.getNewValue());
                    statusMessageLabel.setText((text == null) ? "" : text);
                    messageTimer.restart();
                } else if ("progress".equals(propertyName)) {
                    int value = (Integer)(evt.getNewValue());
                    progressBar.setVisible(true);
                    progressBar.setIndeterminate(false);
                    progressBar.setValue(value);
                }
            }
        });     
        desabilitar_elementos();
        try {
            cargarMEP();
        } catch (FileNotFoundException ex) {
            JOptionPane.showMessageDialog(this.jFrame1, "No se encuentra el archivo con la matriz de transiciones de estados", "ERROR", JOptionPane.ERROR);
            Application.getInstance().exit();
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(this.jFrame1, "No se encuentra el archivo con la matriz de transiciones de estados", "ERROR", JOptionPane.ERROR);
            Application.getInstance().exit();
        }
    }

    @Action
    public void showAboutBox() {
        if (aboutBox == null) {
            JFrame mainFrame = Compilador2011App.getApplication().getMainFrame();
            aboutBox = new Compilador2011AboutBox(mainFrame);
            aboutBox.setLocationRelativeTo(mainFrame);
        }
        Compilador2011App.getApplication().show(aboutBox);
    }
    
    @Action
    public void showAyudaBox() {
        if (ayudaBox == null) {
            JFrame mainFrame = Compilador2011App.getApplication().getMainFrame();
            ayudaBox = new Compilador2011AyudaBox(mainFrame);
            ayudaBox.setLocationRelativeTo(mainFrame);
        }
        Compilador2011App.getApplication().show(ayudaBox);
    }

    @Action
    public void abrirPlan() throws FileNotFoundException, CloneNotSupportedException, IOException{
        jFileChooser1.setCurrentDirectory(new File(".//fuente//"));        
        this.jFileChooser1.grabFocus();
        int returnVal = jFileChooser1.showOpenDialog(jMenuItem1);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            archivo = jFileChooser1.getSelectedFile();
            resetear_contadores_lineas();
            limpiar_areas_de_texto();
            habilitar_elementos();
            ma = new ManejadorArchivo(archivo);
            ma.abrir_archivo();
            Vector<String> lineas= ma.obtener_lineas();
            ma.cerrar_archivo();
            mostrar_fuente(lineas);
            iniciar_analizador_lexico();
            this.jButton1_EjecutarAL.setEnabled(true);
            
        }          
    }

    @Action
    public void obtener_tokens() throws FileNotFoundException, IOException{
        Token t = new Token();
        while(t.getId() != Tokens.eof){
            t = al.obtener_token();
            mostrar_mensaje_AL_tokens(al.get_num_lineas()+" - "+t.toString());
        }
        mostrar_mensaje_TS(ts.values());
    }

    /* Metodos publicos. */

    public void mostrar_fuente(Vector<String> lineas){
        for(Enumeration<String> e= lineas.elements();e.hasMoreElements();){
            String linea= e.nextElement();
            jTextArea1_AFuente_AL.append(cont_lineas_fuente+" - "+linea+"\n");
            jTextArea5_AFuente_GC.append(cont_lineas_fuente+" - "+linea+"\n");
            cont_lineas_fuente++;
        }
    }

    public void mostrar_fuente_AS(Vector<String> lineas){
        for(Enumeration<String> e= lineas.elements();e.hasMoreElements();){
            String linea= e.nextElement();
            this.jTextArea5_AFuente_AS.append(cont_lineas_fuente+" - "+linea+"\n");
            this.jTextArea5_AFuente_GC.append(cont_lineas_fuente+" - "+linea+"\n");
            cont_lineas_fuente++;
        }
    }

    public void mostrar_mensaje_AL_tokens(String mensaje){
        jTextArea2_Tokens_AL.append(mensaje+"\n");
    }

    public void mostrar_mensaje_AL_errores(String mensaje){
        jTextArea4_Info_AL.append(mensaje+"\n");
    }

    public void mostrar_mensaje_TS(Collection<Token> coleccion){
        for(Iterator<Token> it= coleccion.iterator(); it.hasNext();){
            Token ent = it.next();
            jTextArea3_TS_AL.append(ent.toString()+"\n");
        }
    }

    public void mostrar_mensaje_TS_AS(Collection<Token> coleccion){
        for(Iterator<Token> it= coleccion.iterator(); it.hasNext();){
            Token ent = it.next();
            this.jTextArea8_TS_AS.append(ent.toString()+"\n");
            this.jTextArea8_TS_GC.append(ent.toString()+"\n");
        }
    }

    public void mostrar_mensaje_sentencias(String mensaje){
 //VV       
        this.jTextArea6_Sentencias_AS.append(mensaje+"\n");
        this.jTextArea6_Sentencias_GC.append(mensaje+"\n");
    }
    
    public void mostrar_mensaje_informacion(String mensaje){
 //VV
        if (this.jTextArea4_Info_AL.isEnabled()){
            this.jTextArea4_Info_AL.append(mensaje+"\n");
        }
        else{
            this.jTextArea7_Info_AS.append(mensaje+"\n");
            this.jTextArea7_Info_GC.append(mensaje+"\n");
            
        }
    }
    
    public void mostrar_mensaje_tokens(String mensaje){
        if (this.jTextArea2_Tokens_AS.isEnabled()){
            this.jTextArea2_Tokens_AS.append(mensaje);
        }
    }

    public void mostrar_mensaje_codigo(String m){
        this.jTextArea1_Assembler.append(m);
    }
    
    public void update(Observable obs, Object o) {
        //mostrar_mensaje_AL_errores((String) o);
        Mensaje msj = (Mensaje) o;
        if(msj.mensaje_tipo() == Mensaje.INF)
            mostrar_mensaje_informacion(msj.toString());
        else
            if(msj.mensaje_tipo() == Mensaje.SENT)
                mostrar_mensaje_sentencias(msj.toString());
            else
                if(msj.mensaje_tipo() == Mensaje.TOKEN)
                    mostrar_mensaje_tokens(msj.toString());
                else
                    if(msj.mensaje_tipo() == Mensaje.COD)
                        mostrar_mensaje_codigo(msj.toString()); 
    }

    private void resetear_contadores_lineas(){
        cont_lineas_fuente = 1;
        cont_lineas_TS = 1;
    }

    private void limpiar_areas_de_texto(){
        jTextArea1_AFuente_AL.setText("");
        jTextArea2_Tokens_AL.setText("");
        jTextArea2_Tokens_AS.setText("");
        jTextArea3_TS_AL.setText("");
        jTextArea4_Info_AL.setText("");
    }
    private void limpiar_areas_de_texto_AS(){
        this.jTextArea5_AFuente_AS.setText("");
        this.jTextArea6_Sentencias_AS.setText("");
        jTextArea2_Tokens_AS.setText("");
        this.jTextArea7_Info_AS.setText("");
        this.jTextArea8_TS_AS.setText("");
    }
    private void habilitar_elementos(){
        jTextArea1_AFuente_AL.setEnabled(true);
        jTextArea2_Tokens_AL.setEnabled(true);
        jTextArea3_TS_AL.setEnabled(true);
        jTextArea4_Info_AL.setEnabled(true);
        jButton1_EjecutarAL.setEnabled(true);
    }
    private void habilitar_elementos_AS(){
        this.jTextArea5_AFuente_AS.setEnabled(true);
        this.jTextArea6_Sentencias_AS.setEnabled(true);
        this.jTextArea7_Info_AS.setEnabled(true);
        this.jTextArea8_TS_AS.setEnabled(true);
    }
    private void desabilitar_elementos(){
        jTextArea1_AFuente_AL.setEnabled(false);
        jTextArea2_Tokens_AL.setEnabled(false);
        jTextArea3_TS_AL.setEnabled(false);
        jTextArea4_Info_AL.setEnabled(false);
        jButton1_EjecutarAL.setEnabled(false);
    }

    private void iniciar_analizador_lexico() throws FileNotFoundException{
//vv Cambiar la matriz por defecto...
        ts = new TSimbolo();
        al = new AnalizadorLexico(ma, ts);
        al.setMTE(estados);
        al.setMTP(procesos);
        al.addObserver(this);
    }

    private void iniciar_analizador_sintactico(){
        parser = new Parser(al, ts);
        parser.addObserver(this);
    }
    
    private void iniciar_generador_codigo(){
        /*generador = new Generador(this.ts);
        generador.addObserver(this);*/
        polaca = this.parser.getPolaca();
        polaca.addObserver(this);
    }


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
        javax.swing.JMenu helpMenu = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
        statusPanel = new javax.swing.JPanel();
        javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
        statusMessageLabel = new javax.swing.JLabel();
        statusAnimationLabel = new javax.swing.JLabel();
        progressBar = new javax.swing.JProgressBar();
        jFileChooser1 = new javax.swing.JFileChooser();
        jFrame1 = new javax.swing.JFrame();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jScrollPane7 = new javax.swing.JScrollPane();
        jTable3_MatrizTEP = new javax.swing.JTable();
        jSplitPane1 = new javax.swing.JSplitPane();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jScrollPane6 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        ventanaError = new javax.swing.JDialog();
        jOptionPane1 = new javax.swing.JOptionPane();
        jTabbedPane2_ASintactico = new javax.swing.JTabbedPane();
        this.jTabbedPane2_ASintactico.setEnabled(true);
        PanelLexico = new javax.swing.JPanel();
        jToolBar1 = new javax.swing.JToolBar();
        cargarMEP = new javax.swing.JButton();
        jButton2_AbrirFuente = new javax.swing.JButton();
        jButton1_EjecutarAL = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1_AFuente_AL = new javax.swing.JTextArea();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTextArea3_TS_AL = new javax.swing.JTextArea();
        jPanel3 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTextArea2_Tokens_AL = new javax.swing.JTextArea();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTextArea4_Info_AL = new javax.swing.JTextArea();
        PanelSintactico = new javax.swing.JPanel();
        barraSintactico = new javax.swing.JToolBar();
        cargarMTE = new javax.swing.JButton();
        cargarFuenteASintactico = new javax.swing.JButton();
        exeSintactico = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane8 = new javax.swing.JScrollPane();
        jTextArea5_AFuente_AS = new javax.swing.JTextArea();
        jPanel11 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jScrollPane9 = new javax.swing.JScrollPane();
        jTextArea6_Sentencias_AS = new javax.swing.JTextArea();
        jPanel9 = new javax.swing.JPanel();
        jScrollPane10 = new javax.swing.JScrollPane();
        jTextArea7_Info_AS = new javax.swing.JTextArea();
        jPanel7 = new javax.swing.JPanel();
        jScrollPane11 = new javax.swing.JScrollPane();
        jTextArea8_TS_AS = new javax.swing.JTextArea();
        jPanel8 = new javax.swing.JPanel();
        jScrollPane12 = new javax.swing.JScrollPane();
        jTextArea2_Tokens_AS = new javax.swing.JTextArea();
        PanelCodigo = new javax.swing.JPanel();
        jPanel12 = new javax.swing.JPanel();
        jPanel13 = new javax.swing.JPanel();
        jScrollPane14 = new javax.swing.JScrollPane();
        jTextArea6_Sentencias_GC = new javax.swing.JTextArea();
        jPanel14 = new javax.swing.JPanel();
        jScrollPane15 = new javax.swing.JScrollPane();
        jTextArea7_Info_GC = new javax.swing.JTextArea();
        jPanel15 = new javax.swing.JPanel();
        jScrollPane13 = new javax.swing.JScrollPane();
        jTextArea1_Assembler = new javax.swing.JTextArea();
        jPanel16 = new javax.swing.JPanel();
        jScrollPane16 = new javax.swing.JScrollPane();
        jTextArea8_TS_GC = new javax.swing.JTextArea();
        jPanel17 = new javax.swing.JPanel();
        jScrollPane17 = new javax.swing.JScrollPane();
        jTextArea1_Polaca = new javax.swing.JTextArea();
        barraSintactico1 = new javax.swing.JToolBar();
        cargarMTE1 = new javax.swing.JButton();
        cargarFuenteASintactico1 = new javax.swing.JButton();
        exeSintactico1 = new javax.swing.JButton();
        jPanel18 = new javax.swing.JPanel();
        jScrollPane18 = new javax.swing.JScrollPane();
        jTextArea5_AFuente_GC = new javax.swing.JTextArea();

        menuBar.setName("menuBar"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(compilador2011.Compilador2011App.class).getContext().getResourceMap(Compilador2011View.class);
        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(compilador2011.Compilador2011App.class).getContext().getActionMap(Compilador2011View.class, this);
        jMenuItem1.setAction(actionMap.get("cargarMEP")); // NOI18N
        jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        fileMenu.add(jMenuItem1);

        exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
        exitMenuItem.setText(resourceMap.getString("exitMenuItem.text")); // NOI18N
        exitMenuItem.setName("exitMenuItem"); // NOI18N
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
        helpMenu.setName("helpMenu"); // NOI18N

        jMenuItem2.setAction(actionMap.get("showAyudaBox")); // NOI18N
        jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N
        jMenuItem2.setName("jMenuItem2"); // NOI18N
        helpMenu.add(jMenuItem2);

        aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
        aboutMenuItem.setText(resourceMap.getString("aboutMenuItem.text")); // NOI18N
        aboutMenuItem.setName("aboutMenuItem"); // NOI18N
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        statusPanel.setName("statusPanel"); // NOI18N

        statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

        statusMessageLabel.setName("statusMessageLabel"); // NOI18N

        statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

        progressBar.setName("progressBar"); // NOI18N

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 1259, Short.MAX_VALUE)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(statusMessageLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 1089, Short.MAX_VALUE)
                .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(statusAnimationLabel)
                .addContainerGap())
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(statusMessageLabel)
                    .addComponent(statusAnimationLabel)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3))
        );

        jFileChooser1.setName("jFileChooser1"); // NOI18N

        jFrame1.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        jFrame1.setAlwaysOnTop(true);
        jFrame1.setMinimumSize(new java.awt.Dimension(800, 600));
        jFrame1.setName("jFrame1_EstructuraMTE"); // NOI18N

        jTabbedPane1.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
        jTabbedPane1.setAutoscrolls(true);
        jTabbedPane1.setName("jTabbedPane1"); // NOI18N

        jScrollPane7.setName("jScrollPane7"); // NOI18N

        jTable3_MatrizTEP.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable3_MatrizTEP.setName("jTable3_MatrizTEP"); // NOI18N
        jScrollPane7.setViewportView(jTable3_MatrizTEP);

        jTabbedPane1.addTab("MatrizTEP", jScrollPane7);

        jSplitPane1.setDividerLocation(280);
        jSplitPane1.setDividerSize(10);
        jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        jSplitPane1.setAutoscrolls(true);
        jSplitPane1.setName("jSplitPane1"); // NOI18N
        jSplitPane1.setOneTouchExpandable(true);

        jScrollPane5.setAutoscrolls(true);
        jScrollPane5.setName("jScrollPane5"); // NOI18N

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable1.setName("jTable1"); // NOI18N
        jTable1.setPreferredSize(new java.awt.Dimension(600, 400));
        jScrollPane5.setViewportView(jTable1);

        jSplitPane1.setTopComponent(jScrollPane5);

        jScrollPane6.setAutoscrolls(true);
        jScrollPane6.setName("jScrollPane6"); // NOI18N

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable2.setName("jTable2"); // NOI18N
        jTable2.setPreferredSize(new java.awt.Dimension(600, 400));
        jScrollPane6.setViewportView(jTable2);

        jSplitPane1.setRightComponent(jScrollPane6);

        jTabbedPane1.addTab("Estados&Procesos", jSplitPane1);

        javax.swing.GroupLayout jFrame1Layout = new javax.swing.GroupLayout(jFrame1.getContentPane());
        jFrame1.getContentPane().setLayout(jFrame1Layout);
        jFrame1Layout.setHorizontalGroup(
            jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jFrame1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 780, Short.MAX_VALUE)
                .addContainerGap())
        );
        jFrame1Layout.setVerticalGroup(
            jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jFrame1Layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 578, Short.MAX_VALUE)
                .addGap(22, 22, 22))
        );

        ventanaError.setName("ventanaError"); // NOI18N

        jOptionPane1.setName("jOptionPane1"); // NOI18N

        javax.swing.GroupLayout ventanaErrorLayout = new javax.swing.GroupLayout(ventanaError.getContentPane());
        ventanaError.getContentPane().setLayout(ventanaErrorLayout);
        ventanaErrorLayout.setHorizontalGroup(
            ventanaErrorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ventanaErrorLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jOptionPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 285, Short.MAX_VALUE)
                .addContainerGap())
        );
        ventanaErrorLayout.setVerticalGroup(
            ventanaErrorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ventanaErrorLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jOptionPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane2_ASintactico.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jTabbedPane2_ASintactico.setAutoscrolls(true);
        jTabbedPane2_ASintactico.setName("ASintactico"); // NOI18N

        PanelLexico.setName("PanelLexico"); // NOI18N

        jToolBar1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);
        jToolBar1.setName("jToolBar1"); // NOI18N

        cargarMEP.setAction(actionMap.get("cargarMEP")); // NOI18N
        cargarMEP.setText(resourceMap.getString("cargarMEP.text")); // NOI18N
        cargarMEP.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        cargarMEP.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        cargarMEP.setMaximumSize(new java.awt.Dimension(90, 35));
        cargarMEP.setName("cargarMEP"); // NOI18N
        cargarMEP.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(cargarMEP);

        jButton2_AbrirFuente.setAction(actionMap.get("abrirPlan")); // NOI18N
        jButton2_AbrirFuente.setText(resourceMap.getString("jButton2_AbrirFuente.text")); // NOI18N
        jButton2_AbrirFuente.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jButton2_AbrirFuente.setFocusable(false);
        jButton2_AbrirFuente.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton2_AbrirFuente.setMaximumSize(new java.awt.Dimension(90, 37));
        jButton2_AbrirFuente.setName("jButton2_AbrirFuente"); // NOI18N
        jButton2_AbrirFuente.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(jButton2_AbrirFuente);

        jButton1_EjecutarAL.setAction(actionMap.get("obtener_tokens")); // NOI18N
        jButton1_EjecutarAL.setText(resourceMap.getString("jButton1_EjecutarAL.text")); // NOI18N
        jButton1_EjecutarAL.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jButton1_EjecutarAL.setFocusable(false);
        jButton1_EjecutarAL.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1_EjecutarAL.setMaximumSize(new java.awt.Dimension(90, 37));
        jButton1_EjecutarAL.setName("jButton1_EjecutarAL"); // NOI18N
        jButton1_EjecutarAL.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(jButton1_EjecutarAL);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel1.border.title"), javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jTextArea1_AFuente_AL.setColumns(20);
        jTextArea1_AFuente_AL.setEditable(false);
        jTextArea1_AFuente_AL.setFont(resourceMap.getFont("jTextArea1_AFuente_AL.font")); // NOI18N
        jTextArea1_AFuente_AL.setRows(5);
        jTextArea1_AFuente_AL.setBorder(null);
        jTextArea1_AFuente_AL.setName("jTextArea1_AFuente_AL"); // NOI18N
        jScrollPane1.setViewportView(jTextArea1_AFuente_AL);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 931, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE)
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel2.border.title"), javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        jTextArea3_TS_AL.setColumns(20);
        jTextArea3_TS_AL.setEditable(false);
        jTextArea3_TS_AL.setRows(5);
        jTextArea3_TS_AL.setBorder(null);
        jTextArea3_TS_AL.setName("jTextArea3_TS_AL"); // NOI18N
        jScrollPane3.setViewportView(jTextArea3_TS_AL);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 577, Short.MAX_VALUE)
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel3.border.title"), javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel4.border.title"), javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); // NOI18N
        jPanel4.setName("jPanel4"); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        jTextArea2_Tokens_AL.setColumns(20);
        jTextArea2_Tokens_AL.setEditable(false);
        jTextArea2_Tokens_AL.setRows(5);
        jTextArea2_Tokens_AL.setBorder(null);
        jTextArea2_Tokens_AL.setName("jTextArea2_Tokens_AL"); // NOI18N
        jScrollPane2.setViewportView(jTextArea2_Tokens_AL);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE)
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel5.border.title"), javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); // NOI18N
        jPanel5.setName("jPanel5"); // NOI18N

        jScrollPane4.setName("jScrollPane4"); // NOI18N

        jTextArea4_Info_AL.setColumns(20);
        jTextArea4_Info_AL.setEditable(false);
        jTextArea4_Info_AL.setRows(5);
        jTextArea4_Info_AL.setName("jTextArea4_Info_AL"); // NOI18N
        jScrollPane4.setViewportView(jTextArea4_Info_AL);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 432, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 292, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout PanelLexicoLayout = new javax.swing.GroupLayout(PanelLexico);
        PanelLexico.setLayout(PanelLexicoLayout);
        PanelLexicoLayout.setHorizontalGroup(
            PanelLexicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelLexicoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(PanelLexicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addComponent(jToolBar1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1250, Short.MAX_VALUE)
        );
        PanelLexicoLayout.setVerticalGroup(
            PanelLexicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelLexicoLayout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelLexicoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(PanelLexicoLayout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        jTabbedPane2_ASintactico.addTab("A.Lexico", PanelLexico);

        PanelSintactico.setName("PanelSintactico"); // NOI18N

        barraSintactico.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        barraSintactico.setFloatable(false);
        barraSintactico.setRollover(true);
        barraSintactico.setName("barraSintactico"); // NOI18N

        cargarMTE.setAction(actionMap.get("cargarMEP")); // NOI18N
        cargarMTE.setText(resourceMap.getString("cargarMTE.text")); // NOI18N
        cargarMTE.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        cargarMTE.setFocusable(false);
        cargarMTE.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        cargarMTE.setMaximumSize(new java.awt.Dimension(90, 35));
        cargarMTE.setName("cargarMTE"); // NOI18N
        cargarMTE.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        barraSintactico.add(cargarMTE);

        cargarFuenteASintactico.setAction(actionMap.get("cargarFuenteSintactico")); // NOI18N
        cargarFuenteASintactico.setText(resourceMap.getString("cargarFuenteASintactico.text")); // NOI18N
        cargarFuenteASintactico.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        cargarFuenteASintactico.setFocusable(false);
        cargarFuenteASintactico.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        cargarFuenteASintactico.setMaximumSize(new java.awt.Dimension(90, 35));
        cargarFuenteASintactico.setName("cargarFuenteASintactico"); // NOI18N
        cargarFuenteASintactico.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        barraSintactico.add(cargarFuenteASintactico);

        exeSintactico.setAction(actionMap.get("correr_parse")); // NOI18N
        exeSintactico.setText(resourceMap.getString("exeSintactico.text")); // NOI18N
        exeSintactico.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        exeSintactico.setFocusable(false);
        exeSintactico.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        exeSintactico.setMaximumSize(new java.awt.Dimension(90, 35));
        exeSintactico.setName("exeSintactico"); // NOI18N
        exeSintactico.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        barraSintactico.add(exeSintactico);

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Archivo Fuente"));
        jPanel6.setName("jPanel6"); // NOI18N

        jScrollPane8.setName("jScrollPane8"); // NOI18N

        jTextArea5_AFuente_AS.setColumns(20);
        jTextArea5_AFuente_AS.setEditable(false);
        jTextArea5_AFuente_AS.setRows(5);
        jTextArea5_AFuente_AS.setName("jTextArea5_AFuente_AS"); // NOI18N
        jScrollPane8.setViewportView(jTextArea5_AFuente_AS);

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 592, Short.MAX_VALUE)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 255, Short.MAX_VALUE)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScrollPane8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
        );

        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel11.border.title"), javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); // NOI18N
        jPanel11.setName("jPanel11"); // NOI18N

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Sentencias"));
        jPanel10.setName("jPanel10"); // NOI18N

        jScrollPane9.setName("jScrollPane9"); // NOI18N

        jTextArea6_Sentencias_AS.setColumns(20);
        jTextArea6_Sentencias_AS.setRows(5);
        jTextArea6_Sentencias_AS.setName("jTextArea6_Sentencias_AS"); // NOI18N
        jScrollPane9.setViewportView(jTextArea6_Sentencias_AS);

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE)
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder("Información"));
        jPanel9.setName("jPanel9"); // NOI18N

        jScrollPane10.setName("jScrollPane10"); // NOI18N

        jTextArea7_Info_AS.setColumns(20);
        jTextArea7_Info_AS.setRows(5);
        jTextArea7_Info_AS.setName("jTextArea7_Info_AS"); // NOI18N
        jScrollPane10.setViewportView(jTextArea7_Info_AS);

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane10, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane10, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Tabla de Simbolos"));
        jPanel7.setName("jPanel7"); // NOI18N

        jScrollPane11.setName("jScrollPane11"); // NOI18N

        jTextArea8_TS_AS.setColumns(20);
        jTextArea8_TS_AS.setRows(5);
        jTextArea8_TS_AS.setName("jTextArea8_TS_AS"); // NOI18N
        jScrollPane11.setViewportView(jTextArea8_TS_AS);

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 588, Short.MAX_VALUE)
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 287, Short.MAX_VALUE)
        );

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel8.border.title"), javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION)); // NOI18N
        jPanel8.setName("jPanel8"); // NOI18N

        jScrollPane12.setName("jScrollPane12"); // NOI18N

        jTextArea2_Tokens_AS.setColumns(20);
        jTextArea2_Tokens_AS.setEditable(false);
        jTextArea2_Tokens_AS.setRows(5);
        jTextArea2_Tokens_AS.setBorder(null);
        jTextArea2_Tokens_AS.setName("jTextArea2_Tokens_AS"); // NOI18N
        jScrollPane12.setViewportView(jTextArea2_Tokens_AS);

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 578, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 255, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout PanelSintacticoLayout = new javax.swing.GroupLayout(PanelSintactico);
        PanelSintactico.setLayout(PanelSintacticoLayout);
        PanelSintacticoLayout.setHorizontalGroup(
            PanelSintacticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelSintacticoLayout.createSequentialGroup()
                .addGroup(PanelSintacticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(barraSintactico, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 1240, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, PanelSintacticoLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(PanelSintacticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(PanelSintacticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(PanelSintacticoLayout.createSequentialGroup()
                                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(12, 12, 12))
                            .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        PanelSintacticoLayout.setVerticalGroup(
            PanelSintacticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelSintacticoLayout.createSequentialGroup()
                .addComponent(barraSintactico, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelSintacticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(PanelSintacticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        jTabbedPane2_ASintactico.addTab("A.Sintactico", PanelSintactico);

        PanelCodigo.setName("PanelCodigo"); // NOI18N

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Analizador Sintactico", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION));
        jPanel12.setName("jPanel12"); // NOI18N

        jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder("Sentencias"));
        jPanel13.setName("jPanel13"); // NOI18N

        jScrollPane14.setName("jScrollPane14"); // NOI18N

        jTextArea6_Sentencias_GC.setColumns(20);
        jTextArea6_Sentencias_GC.setRows(5);
        jTextArea6_Sentencias_GC.setName("jTextArea6_Sentencias_GC"); // NOI18N
        jScrollPane14.setViewportView(jTextArea6_Sentencias_GC);

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane14, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane14, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
        );

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder("Información"));
        jPanel14.setName("jPanel14"); // NOI18N

        jScrollPane15.setName("jScrollPane15"); // NOI18N

        jTextArea7_Info_GC.setColumns(20);
        jTextArea7_Info_GC.setRows(5);
        jTextArea7_Info_GC.setName("jTextArea7_Info_GC"); // NOI18N
        jScrollPane15.setViewportView(jTextArea7_Info_GC);

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane15, javax.swing.GroupLayout.DEFAULT_SIZE, 334, Short.MAX_VALUE)
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane15, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder("Codigo Assembler"));
        jPanel15.setName("jPanel15"); // NOI18N

        jScrollPane13.setName("jScrollPane13"); // NOI18N

        jTextArea1_Assembler.setColumns(20);
        jTextArea1_Assembler.setRows(5);
        jTextArea1_Assembler.setName("jTextArea1_Assembler"); // NOI18N
        jScrollPane13.setViewportView(jTextArea1_Assembler);

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane13, javax.swing.GroupLayout.DEFAULT_SIZE, 487, Short.MAX_VALUE)
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane13, javax.swing.GroupLayout.DEFAULT_SIZE, 328, Short.MAX_VALUE)
        );

        jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder("Tabla de Simbolos"));
        jPanel16.setName("jPanel16"); // NOI18N

        jScrollPane16.setName("jScrollPane16"); // NOI18N

        jTextArea8_TS_GC.setColumns(20);
        jTextArea8_TS_GC.setRows(5);
        jTextArea8_TS_GC.setName("jTextArea8_TS_GC"); // NOI18N
        jScrollPane16.setViewportView(jTextArea8_TS_GC);

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane16, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 487, Short.MAX_VALUE)
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane16, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
        );

        jPanel17.setBorder(javax.swing.BorderFactory.createTitledBorder("Polaca Inversa"));
        jPanel17.setName("jPanel17"); // NOI18N

        jScrollPane17.setName("jScrollPane17"); // NOI18N

        jTextArea1_Polaca.setColumns(20);
        jTextArea1_Polaca.setRows(5);
        jTextArea1_Polaca.setName("jTextArea1_Polaca"); // NOI18N
        jScrollPane17.setViewportView(jTextArea1_Polaca);

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane17, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 705, Short.MAX_VALUE)
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane17, javax.swing.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE))
        );

        barraSintactico1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        barraSintactico1.setFloatable(false);
        barraSintactico1.setRollover(true);
        barraSintactico1.setName("barraSintactico1"); // NOI18N

        cargarMTE1.setAction(actionMap.get("cargarMEP")); // NOI18N
        cargarMTE1.setText(resourceMap.getString("cargarMTE1.text")); // NOI18N
        cargarMTE1.setEnabled(false);
        cargarMTE1.setFocusable(false);
        cargarMTE1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        cargarMTE1.setMaximumSize(new java.awt.Dimension(90, 35));
        cargarMTE1.setName("cargarMTE1"); // NOI18N
        cargarMTE1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        barraSintactico1.add(cargarMTE1);

        cargarFuenteASintactico1.setAction(actionMap.get("cargarFuenteSintactico")); // NOI18N
        cargarFuenteASintactico1.setText(resourceMap.getString("cargarFuenteASintactico1.text")); // NOI18N
        cargarFuenteASintactico1.setFocusable(false);
        cargarFuenteASintactico1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        cargarFuenteASintactico1.setMaximumSize(new java.awt.Dimension(90, 35));
        cargarFuenteASintactico1.setName("cargarFuenteASintactico1"); // NOI18N
        cargarFuenteASintactico1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        barraSintactico1.add(cargarFuenteASintactico1);

        exeSintactico1.setAction(actionMap.get("correr_parse")); // NOI18N
        exeSintactico1.setText(resourceMap.getString("exeSintactico1.text")); // NOI18N
        exeSintactico1.setEnabled(false);
        exeSintactico1.setFocusable(false);
        exeSintactico1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        exeSintactico1.setMaximumSize(new java.awt.Dimension(90, 35));
        exeSintactico1.setName("exeSintactico1"); // NOI18N
        exeSintactico1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        barraSintactico1.add(exeSintactico1);

        jPanel18.setBorder(javax.swing.BorderFactory.createTitledBorder("Archivo Fuente"));
        jPanel18.setName("jPanel18"); // NOI18N

        jScrollPane18.setName("jScrollPane18"); // NOI18N

        jTextArea5_AFuente_GC.setColumns(20);
        jTextArea5_AFuente_GC.setEditable(false);
        jTextArea5_AFuente_GC.setRows(5);
        jTextArea5_AFuente_GC.setName("jTextArea5_AFuente_GC"); // NOI18N
        jScrollPane18.setViewportView(jTextArea5_AFuente_GC);

        javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
        jPanel18.setLayout(jPanel18Layout);
        jPanel18Layout.setHorizontalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 705, Short.MAX_VALUE)
            .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScrollPane18, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
        );
        jPanel18Layout.setVerticalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 184, Short.MAX_VALUE)
            .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScrollPane18, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout PanelCodigoLayout = new javax.swing.GroupLayout(PanelCodigo);
        PanelCodigo.setLayout(PanelCodigoLayout);
        PanelCodigoLayout.setHorizontalGroup(
            PanelCodigoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, PanelCodigoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(PanelCodigoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelCodigoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
            .addComponent(barraSintactico1, javax.swing.GroupLayout.DEFAULT_SIZE, 1250, Short.MAX_VALUE)
        );
        PanelCodigoLayout.setVerticalGroup(
            PanelCodigoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelCodigoLayout.createSequentialGroup()
                .addComponent(barraSintactico1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelCodigoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelCodigoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PanelCodigoLayout.createSequentialGroup()
                        .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        jTabbedPane2_ASintactico.addTab(resourceMap.getString("PanelCodigo.TabConstraints.tabTitle"), PanelCodigo); // NOI18N

        setComponent(jTabbedPane2_ASintactico);
        setMenuBar(menuBar);
        setStatusBar(statusPanel);
    }// </editor-fold>//GEN-END:initComponents


    @Action
    @SuppressWarnings("static-access")
    /**
     * En este metodo voy a cargar la matriz de estados y procesos o acciones semanticas...
     */
    public void cargarMEP() throws FileNotFoundException, IOException {

        /*this.jFileChooser1.setCurrentDirectory(new File(".//fuente//"));
        int returnVal = jFileChooser1.showOpenDialog(jMenuItem1);

        if (returnVal == JFileChooser.APPROVE_OPTION) {
            archivo = jFileChooser1.getSelectedFile();*/
        archivo = new File(".//fuente/MatrizTE/Matriz_G7.csv");
        this.jFrame1.setTitle("Matriz de Estados y Acciones Semanticas");
        //this.jFrame1.setTitle("Diseño de Compiladores I - " + archivo.getName());
            FileReader LectorArchivoCaracteres = new FileReader(archivo);
            BufferedReader FilaMTE= new BufferedReader(LectorArchivoCaracteres);

            String Fila = null;
            //Generalmente no son mas de 30 estados para este practico...
            ArrayList MatrizProcesos= new ArrayList(30);

            //1-Leo los encabezados de la matriz...
            Fila = FilaMTE.readLine();
            String [] encabezados = null;
            
            if (Fila != null){
                encabezados = Fila.split("#");
            } else{
                
                this.jOptionPane1.showMessageDialog(this.ventanaError, "Faltan encabezados para visualizar la Matriz_TE", "ErrorDeCarga_MTE", this.jOptionPane1.ERROR_MESSAGE);
                this.ventanaError.setVisible(true);
            }

            //2-Leo el tamaño de la matriz
            Fila = FilaMTE.readLine();
            String [] limites = Fila.split("x");

            //3-Leo los estados y procesos o as...
            Fila = FilaMTE.readLine();
            while  (Fila != null){
                String [] FilaX = Fila.split("@");
                MatrizProcesos.add(FilaX);
                Fila = FilaMTE.readLine();

            }//while

            //Minimizo lo que no use...
            MatrizProcesos.trimToSize();

            //Me fijo cuantas columnas son... debería ser siempre la misma cantidad...
            int cols = Array.getLength((String[]) MatrizProcesos.get(0));

            //Inicializo la Matriz... col y segun la cantidad de filas...
            this.estados = new int[MatrizProcesos.size()][cols];
            this.procesos = new int[MatrizProcesos.size()][cols];
            //Matriz auxiliar para visualizar la tabla... hago +1 porque despues agrego el numero de estado
            Object[][] MatrizTEP = new String[MatrizProcesos.size()+1][cols+1];

            String[] elemento = {"-8","-8"};
            for(int fila=0; fila < MatrizProcesos.size(); fila++){

                //Leo una fila de caracteres para la matriz
                String[] fila_i = (String[]) MatrizProcesos.get(fila);
                for (int j=0; j<cols; j++){

                    MatrizTEP[fila+1][j+1] = fila_i[j];
                    elemento = fila_i[j].split("/");
                    this.estados[fila][j]=Integer.parseInt(elemento[0]);
                    this.procesos[fila][j]=Integer.parseInt(elemento[1]);
                }//for
            }//for

            //Defino una tabla object para el JTable para visualizar....
            int f = Integer.parseInt(limites[0]);
            int c = Integer.parseInt(limites[1]);
            Object[][] TablaE = new Integer[f+1][c+1];
            Object[][] TablaP = new Integer[f+1][c+1];

        
            //Agrego columna con los Numeros de Estados...
            for(int k=0; k<1; k++){
                for(int h=0; h<f; h++){

                    MatrizTEP[h+1][k]=Integer.toString(h);
                    TablaE[h+1][k]=h;
                    TablaP[h+1][k]=h;
                }

            }

            //Agrego fila con los Numeros de columnas 0-15...
            for(int h=0; h<1; h++){
                for(int k=0; k<c; k++){

                    MatrizTEP[h][k+1]=Integer.toString(k);
                    TablaE[h][k+1]=k;
                    TablaP[h][k+1]=k;
                }

            }

            //int[][] estados = this.al.getME();
            //int[][] procesos = this.al.getMP();
            //this.al.setME(this.estados);
            //this.al.setMP(this.procesos);

            //Es por si quiero mostrar una matriz de enteros con la JTable, lo uso para pruebas...
            for (int i=1;i<=f;i++){
               for(int j=1; j<=c; j++){

                   TablaE[i][j]= this.estados[i-1][j-1];
                   TablaP[i][j]= this.procesos[i-1][j-1];
               }
            }
            
            this.jTable1.setModel(new DefaultTableModel(TablaE,encabezados));
            this.jTable2.setModel(new DefaultTableModel(TablaP,encabezados));
            this.jTable3_MatrizTEP.setModel(new DefaultTableModel(MatrizTEP,encabezados));
            this.jFrame1.setVisible(true);

            this.jButton2_AbrirFuente.setEnabled(true);
            this.cargarFuenteASintactico.setEnabled(true);
         /* this.al.setMTE(this.estados);
            this.al.setMTP(this.procesos);
         */
        //if
        this.jButton2_AbrirFuente.setEnabled(true);
        this.cargarFuenteASintactico.setEnabled(true);
    }

    @Action
    public void cargarFuenteSintactico() throws FileNotFoundException, IOException {
        jFileChooser1.setCurrentDirectory(new File(".//fuente//"));
                int returnVal = jFileChooser1.showOpenDialog(jMenuItem1);
                if (returnVal == JFileChooser.APPROVE_OPTION) {
                    archivo = jFileChooser1.getSelectedFile();
                    this.getFrame().setTitle("Diseño de Compiladores I - " + archivo.getName());
                    desabilitar_elementos();
                    resetear_contadores_lineas();
                    limpiar_areas_de_texto_AS();
                    habilitar_elementos_AS();
                    ma = new ManejadorArchivo(archivo);
                    ma.abrir_archivo();
                    Vector<String> lineas= ma.obtener_lineas();
                    ma.cerrar_archivo();
                    mostrar_fuente_AS(lineas);
                    iniciar_analizador_lexico();
                    iniciar_analizador_sintactico();
                    iniciar_generador_codigo();
                    this.exeSintactico.setEnabled(true);
                    this.exeSintactico1.setEnabled(true);
                }
         this.exeSintactico.setEnabled(true);
    }

    @Action
    public void correr_parse() throws FileNotFoundException, IOException {
        parser.run();
        mostrar_mensaje_TS_AS(ts.values());
        /*Token t1 = new Token_Ulongint(200l);
        Token t2 = new Token_Uinteger(100l);
        //l.add(new Token_Cadena(Tokens.var, "a"));
        Token t3 = new Token_Cadena("CADENA");  
        ts.vaciar();
        ts.put(t1);
        ts.put(t2);
        ts.put(t3);
        //l.add(new Token(Tokens.asignacion));
        polaca.addElemento(t1);
        polaca.addElemento(t2);
        polaca.addElemento(new Token_OperadorSuma());
        polaca.addElemento(t3);*/
        List<Token> elem = parser.getPolaca().getElementos();
        //this.jTable3 = new JTable(1,elem.size());
        jTextArea1_Polaca.append(elem.toString());
        //this.jTable3 = new JTable(new Object[][]{}, elem.toArray());
        if(parser.getPolaca().traducir()){
            DefaultEditorKit ek = new DefaultEditorKit();
            String archivo = ma.nombre_archivo();
            FileOutputStream f = new FileOutputStream(archivo + ".asm");
            try {
                ek.write(f, this.jTextArea1_Assembler.getDocument(), 0, this.jTextArea1_Assembler.getDocument().getLength());
                f.close();
            } catch (BadLocationException ex) {
                Logger.getLogger(Compilador2011View.class.getName()).log(Level.SEVERE, null, ex);
            }
            /*Process p = Runtime.getRuntime().exec("ml /c /coff " + archivo + ".asm");
            Process p1 = Runtime.getRuntime().exec("link /SUBSYSTEM:CONSOLE " + archivo + ".obj");*/
            Runtime.getRuntime().exec("ejecutable.bat " + archivo);
        }
        else{
            JOptionPane.showMessageDialog(this.jFrame1, "Ha ocurrido un error durante la generación de código assembler.\nNo se pudo generar el ejecutable.", "Error en Generación de Código", JOptionPane.ERROR_MESSAGE);
        }
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel PanelCodigo;
    private javax.swing.JPanel PanelLexico;
    private javax.swing.JPanel PanelSintactico;
    private javax.swing.JToolBar barraSintactico;
    private javax.swing.JToolBar barraSintactico1;
    private javax.swing.JButton cargarFuenteASintactico;
    private javax.swing.JButton cargarFuenteASintactico1;
    private javax.swing.JButton cargarMEP;
    private javax.swing.JButton cargarMTE;
    private javax.swing.JButton cargarMTE1;
    private javax.swing.JButton exeSintactico;
    private javax.swing.JButton exeSintactico1;
    private javax.swing.JButton jButton1_EjecutarAL;
    private javax.swing.JButton jButton2_AbrirFuente;
    private javax.swing.JFileChooser jFileChooser1;
    private javax.swing.JFrame jFrame1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JOptionPane jOptionPane1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane15;
    private javax.swing.JScrollPane jScrollPane16;
    private javax.swing.JScrollPane jScrollPane17;
    private javax.swing.JScrollPane jScrollPane18;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JTabbedPane jTabbedPane1;
    public javax.swing.JTabbedPane jTabbedPane2_ASintactico;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTable3_MatrizTEP;
    private javax.swing.JTextArea jTextArea1_AFuente_AL;
    private javax.swing.JTextArea jTextArea1_Assembler;
    private javax.swing.JTextArea jTextArea1_Polaca;
    private javax.swing.JTextArea jTextArea2_Tokens_AL;
    private javax.swing.JTextArea jTextArea2_Tokens_AS;
    private javax.swing.JTextArea jTextArea3_TS_AL;
    private javax.swing.JTextArea jTextArea4_Info_AL;
    private javax.swing.JTextArea jTextArea5_AFuente_AS;
    private javax.swing.JTextArea jTextArea5_AFuente_GC;
    private javax.swing.JTextArea jTextArea6_Sentencias_AS;
    private javax.swing.JTextArea jTextArea6_Sentencias_GC;
    private javax.swing.JTextArea jTextArea7_Info_AS;
    private javax.swing.JTextArea jTextArea7_Info_GC;
    private javax.swing.JTextArea jTextArea8_TS_AS;
    private javax.swing.JTextArea jTextArea8_TS_GC;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JProgressBar progressBar;
    private javax.swing.JLabel statusAnimationLabel;
    private javax.swing.JLabel statusMessageLabel;
    private javax.swing.JPanel statusPanel;
    private javax.swing.JDialog ventanaError;
    // End of variables declaration//GEN-END:variables

    private javax.swing.JTable ME;

    private final Timer messageTimer;
    private final Timer busyIconTimer;
    private final Icon idleIcon;
    private final Icon[] busyIcons = new Icon[15];
    private int busyIconIndex = 0;

    private JDialog aboutBox;
    private JDialog ayudaBox;

    ManejadorArchivo ma;
    File archivo;
    AnalizadorLexico al;
    TSimbolo ts;

    int cont_lineas_fuente = 1;
    int cont_lineas_TS = 1;

    //Analisis Sintactico
    Parser parser;
    
    //Generador de Codigo Assembler
    private Polaca polaca;

    //Pruebas
    int [][] MTE;
    int [][] procesos;
    int [][] estados;
}
